package com.huawei.petapp2.provider;


import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.huawei.petapp2.R;
import com.huawei.petapp2.adapter.TestHomeAdapter;
import com.huawei.petapp2.adapter.TestItemAdapter;
import com.huawei.petapp2.entity.Recomment;


/**
 * Created by 吕氏春秋i 2020/4/30
 * Describe:
 */


public class ScrollItemProvider extends BaseItemProvider<Recomment, BaseViewHolder> {
    @Override
    public int viewType() {
        return TestHomeAdapter.TYPE_HORIZONTAL_SCROLL;
    }

    @Override
    public int layout() {
        return R.layout.app_item_home_scroll;
    }

    @Override
    public void convert(BaseViewHolder helper, Recomment data, int position) {
        {
            RecyclerView mRecyclerView = helper.getView(R.id.item_list);
            mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
            TestItemAdapter adapter = new TestItemAdapter();
            //TODO TODO
            adapter.setNewData(null);
            mRecyclerView.setAdapter(adapter);
        }

    }
}
